package com.parktech.sun.domain.repository.downloadcenter.hibernate;

import com.parktech.sun.domain.model.downloadcenter.ResourceFile;
import com.parktech.sun.domain.model.downloadcenter.ResourceType;
import com.parktech.sun.domain.repository.downloadcenter.ResourceFileRepository;
import com.parktech.sun.domain.repository.hibernate.BaseRepositoryImpl;
import org.springframework.stereotype.Repository;

/**
 * User: Think
 * Date: 11-1-23
 * Time: 下午11:49
 */
@Repository
public class ResourceFileRepositoryImpl extends BaseRepositoryImpl<ResourceFile> implements ResourceFileRepository {

    public ResourceType getTypeById(Long resourceTypeId) {
        return (ResourceType) getSession().get(ResourceType.class, resourceTypeId);
    }

    public void saveOrUpdateType(ResourceType resourceType) {
        getSession().saveOrUpdate(resourceType);
    }
}
